package stud.aistar.mapper;

import org.apache.ibatis.annotations.Select;
import stud.aistar.entity.SecondDepartment;

import java.util.List;

/**
 * Created by Jcdz on 2019/9/28.
 */
public interface SecondDepartmentMapper {

    @Select("select * from second_department")
    List<SecondDepartment> findAll();

    @Select("select * from second_department where dept_id=#{value}")
    List<SecondDepartment> findByDeptId(Integer id);

    @Select("select * from second_department where id=#{value}")
    SecondDepartment findById(Integer id);

    @Select("select dept_id from second_department where id=#{value}")
    Integer findDeptIdById(Integer id);

    @Select("select s.id,s.sdept_name,s.intro,s.dept_id from department d join second_department s on d.id = s.dept_id where dept_id=#{value}")
    List<SecondDepartment> findBydeptId(Integer deptId);

}
